<template>
  <div class="box">
    <h1>header22</h1>
    <button @click="add">+</button>
  </div>
</template>

<script>
export default {
    methods: {
        add() {
            // 调用事件
            this.$bus.$emit('add' , 2)
        }
    },
    created() {
        console.log(this.$bus)
    }
}
</script>

<style>

</style>